Hi all, |
Re: AttrDXL to show baselined version of Object Text
Nope there is no such function unfortunately. But there is a pretty straightforward way to achieve this (open baseline, find object, display its contents). I would suggest a DXL attribute for this. I guess a good start would be something like this:
<code class="jive-code jive-java">
Module m = current Object oCur = obj <span style="color: navy">
<b>
if</b></span> (<s<code class="jive-code jive-java">
Module m = current Object oCur = obj <span style="color: navy">
<b>
if</b></span> (<span style="color: navy">
<b>
null</b></span> getMostRecentBaseline m) halt <span style="color: darkgreen">
// no baseline here ...</span> ModuleVersion mv = moduleVersion (module m, getMostRecentBaseline m) Module bsMod = data mv <span style="color: navy">
<b>
if</b></span> (<span style="color: navy">
<b>
null</b></span> bsMod) bsMod = load(mv, <span style="color: navy">
<b>
false</b></span>) <span style="color: navy">
<b>
if</b></span> (<span style="color: navy">
<b>
null</b></span> bsMod) halt <span style="color: navy">
<b>
int</b></span> iCurNr = oCur.<span style="color: red">
"Absolute Number"</span> Object oBS = object(iCurNr, bsMod) <span style="color: darkgreen">
// make sure that we also find invisible objects, in case a stupid</span> <span style="color: darkgreen">
// default view filters away stuff, you never know ...</span> <span style="color: darkgreen">
// ok. I don't trust the object(...) function, so you probably</span> <span style="color: darkgreen">
// don't need this. This slows stuff down.</span> <span style="color: darkgreen">
// ---------------------</span> <span style="color: navy">
<b>
if</b></span> (<span style="color: navy">
<b>
null</b></span> oBS) <span style="color: navy">
{</span> Object oSearch; <span style="color: navy">
<b>
for</b></span> oSearch in entire bsMod <span style="color: navy">
<b>Module m = current
Object oCur = obj
if (null getMostRecentBaseline m) halt // no baseline here ...
ModuleVersion mv = moduleVersion (module m, getMostRecentBaseline m)
Module bsMod = data mv
if (null bsMod) bsMod = load(mv, false)
if (null bsMod) halt
int iCurNr = oCur."Absolute Number"
Object oBS = object(iCurNr, bsMod)
// make sure that we also find invisible objects, in case a stupid
// default view filters away stuff, you never know ...
// ok. I don't trust the object(...) function, so you probably
// don't need this. This slows stuff down.
// ---------------------
if (null oBS) {
Object oSearch;
for oSearch in entire bsMod do {
int iSearchNr = oSearch."Absolute Number";
if (iSearchNr == iCurNr) { oBS = oSearch; break }
}
}
// --------------------
if (null oBS) halt // we did not find anything
// Use this for DXL Layout
// displayRichWithColor richTextWithOle(oBS."Object Text")
// Use this for a DXL attribute
oCur.attrDXLName = richText richTextWithOle(oBS."Object Text")
do</b></span> <span style="color: navy">
{</span> <span style="color: navy">
<b>
int</b></span> iSearchNr = oSearch.<span style="color: red">
"Absolute Number"</span>; <span style="color: navy">
<b>
if</b></span> (iSearchNr == iCurNr) <span style="color: navy">
{</span> oBS = oSearch; <span style="color: navy">
<b>
break</b></span> <span style="color: navy">
}</span> <span style="color: navy">
}</span> <span style="color: navy">
}</span> <span style="color: darkgreen">
// --------------------</span> <span style="color: navy">
<b>
if</b></span> (<span style="color: navy">
<b>
null</b></span> oBS) halt <span style="color: darkgreen">
// we did not find anything</span> <span style="color: darkgreen">
// Use this for DXL Layout</span> <span style="color: darkgreen">
// displayRichWithColor richTextWithOle(oBS."Object Text")</span> <span style="color: darkgreen">
// Use this for a DXL attribute</span> oCur.attrDXLName = richText richTextWithOle(oBS.<span style="color: red">
"Object Text"</span>)</code>
pan style="color: navy">
<b>
null</b></span> getMostRecentBaseline m) halt <span style="color: darkgreen">
// no baseline here ...</span> ModuleVersion mv = moduleVersion (module m, getMostRecentBaseline m) Module bsMod = data mv <span style="color: navy">
<b>
if</b></span> (<span style="color: navy">
<b>
null</b></span> bsMod) bsMod = load(mv, <span style="color: navy">
<b>
false</b></span>) <span style="color: navy">
<b>
if</b></span> (<span style="color: navy">
<b>
null</b></span> bsMod) halt <span style="color: navy">
<b>
int</b></span> iCurNr = oCur.<span style="color: red">
"Absolute Number"</span> Object oBS = object(iCurNr, bsMod) <span style="color: darkgreen">
// make sure that we also find invisible objects, in case a stupid</span> <span style="color: darkgreen">
// default view filters away stuff, you never know ...</span> <span style="color: darkgreen">
// ok. I don't trust the object(...) function, so you probably</span> <span style="color: darkgreen">
// don't need this. This slows stuff down.</span> <span style="color: darkgreen">
// ---------------------</span> <span style="color: navy">
<b>
if</b></span> (<span style="color: navy">
<b>
null</b></span> oBS) <span style="color: navy">
{</span> Object oSearch; <span style="color: navy">
<b>
for</b></span> oSearch in entire bsMod <span style="color: navy">
<b>
do</b></span> <span style="color: navy">
{</span> <span style="color: navy">
<b>
int</b></span> iSearchNr = oSearch.<span style="color: red">
"Absolute Number"</span>; <span style="color: navy">
<b>
if</b></span> (iSearchNr == iCurNr) <span style="color: navy">
{</span> oBS = oSearch; <span style="color: navy">
<b>
break</b></span> <span style="color: navy">
}</span> <span style="color: navy">
}</span> <span style="color: navy">
}</span> <span style="color: darkgreen">
// --------------------</span> <span style="color: navy">
<b>
if</b></span> (<span style="color: navy">
<b>
null</b></span> oBS) halt <span style="color: darkgreen">
// we did not find anything</span> <span style="color: darkgreen">
// Use this for DXL Layout</span> <span style="color: darkgreen">
// displayRichWithColor richTextWithOle(oBS."Object Text")</span> <span style="color: darkgreen">
// Use this for a DXL attribute</span> oCur.attrDXLName = richText richTextWithOle(oBS.<span style="color: red">
"Object Text"</span>)</code>
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: AttrDXL to show baselined version of Object Text Mathias Mamsch - Fri Jan 07 15:46:10 EST 2011
Nope there is no such function unfortunately. But there is a pretty straightforward way to achieve this (open baseline, find object, display its contents). I would suggest a DXL attribute for this. I guess a good start would be something like this:
<code class="jive-code jive-java">
Module m = current Object oCur = obj <span style="color: navy">
<b>
if</b></span> (<s<code class="jive-code jive-java">
Module m = current Object oCur = obj <span style="color: navy">
<b>
if</b></span> (<span style="color: navy">
<b>
null</b></span> getMostRecentBaseline m) halt <span style="color: darkgreen">
// no baseline here ...</span> ModuleVersion mv = moduleVersion (module m, getMostRecentBaseline m) Module bsMod = data mv <span style="color: navy">
<b>
if</b></span> (<span style="color: navy">
<b>
null</b></span> bsMod) bsMod = load(mv, <span style="color: navy">
<b>
false</b></span>) <span style="color: navy">
<b>
if</b></span> (<span style="color: navy">
<b>
null</b></span> bsMod) halt <span style="color: navy">
<b>
int</b></span> iCurNr = oCur.<span style="color: red">
"Absolute Number"</span> Object oBS = object(iCurNr, bsMod) <span style="color: darkgreen">
// make sure that we also find invisible objects, in case a stupid</span> <span style="color: darkgreen">
// default view filters away stuff, you never know ...</span> <span style="color: darkgreen">
// ok. I don't trust the object(...) function, so you probably</span> <span style="color: darkgreen">
// don't need this. This slows stuff down.</span> <span style="color: darkgreen">
// ---------------------</span> <span style="color: navy">
<b>
if</b></span> (<span style="color: navy">
<b>
null</b></span> oBS) <span style="color: navy">
{</span> Object oSearch; <span style="color: navy">
<b>
for</b></span> oSearch in entire bsMod <span style="color: navy">
<b>Module m = current
Object oCur = obj
if (null getMostRecentBaseline m) halt // no baseline here ...
ModuleVersion mv = moduleVersion (module m, getMostRecentBaseline m)
Module bsMod = data mv
if (null bsMod) bsMod = load(mv, false)
if (null bsMod) halt
int iCurNr = oCur."Absolute Number"
Object oBS = object(iCurNr, bsMod)
// make sure that we also find invisible objects, in case a stupid
// default view filters away stuff, you never know ...
// ok. I don't trust the object(...) function, so you probably
// don't need this. This slows stuff down.
// ---------------------
if (null oBS) {
Object oSearch;
for oSearch in entire bsMod do {
int iSearchNr = oSearch."Absolute Number";
if (iSearchNr == iCurNr) { oBS = oSearch; break }
}
}
// --------------------
if (null oBS) halt // we did not find anything
// Use this for DXL Layout
// displayRichWithColor richTextWithOle(oBS."Object Text")
// Use this for a DXL attribute
oCur.attrDXLName = richText richTextWithOle(oBS."Object Text")
do</b></span> <span style="color: navy">
{</span> <span style="color: navy">
<b>
int</b></span> iSearchNr = oSearch.<span style="color: red">
"Absolute Number"</span>; <span style="color: navy">
<b>
if</b></span> (iSearchNr == iCurNr) <span style="color: navy">
{</span> oBS = oSearch; <span style="color: navy">
<b>
break</b></span> <span style="color: navy">
}</span> <span style="color: navy">
}</span> <span style="color: navy">
}</span> <span style="color: darkgreen">
// --------------------</span> <span style="color: navy">
<b>
if</b></span> (<span style="color: navy">
<b>
null</b></span> oBS) halt <span style="color: darkgreen">
// we did not find anything</span> <span style="color: darkgreen">
// Use this for DXL Layout</span> <span style="color: darkgreen">
// displayRichWithColor richTextWithOle(oBS."Object Text")</span> <span style="color: darkgreen">
// Use this for a DXL attribute</span> oCur.attrDXLName = richText richTextWithOle(oBS.<span style="color: red">
"Object Text"</span>)</code>
pan style="color: navy">
<b>
null</b></span> getMostRecentBaseline m) halt <span style="color: darkgreen">
// no baseline here ...</span> ModuleVersion mv = moduleVersion (module m, getMostRecentBaseline m) Module bsMod = data mv <span style="color: navy">
<b>
if</b></span> (<span style="color: navy">
<b>
null</b></span> bsMod) bsMod = load(mv, <span style="color: navy">
<b>
false</b></span>) <span style="color: navy">
<b>
if</b></span> (<span style="color: navy">
<b>
null</b></span> bsMod) halt <span style="color: navy">
<b>
int</b></span> iCurNr = oCur.<span style="color: red">
"Absolute Number"</span> Object oBS = object(iCurNr, bsMod) <span style="color: darkgreen">
// make sure that we also find invisible objects, in case a stupid</span> <span style="color: darkgreen">
// default view filters away stuff, you never know ...</span> <span style="color: darkgreen">
// ok. I don't trust the object(...) function, so you probably</span> <span style="color: darkgreen">
// don't need this. This slows stuff down.</span> <span style="color: darkgreen">
// ---------------------</span> <span style="color: navy">
<b>
if</b></span> (<span style="color: navy">
<b>
null</b></span> oBS) <span style="color: navy">
{</span> Object oSearch; <span style="color: navy">
<b>
for</b></span> oSearch in entire bsMod <span style="color: navy">
<b>
do</b></span> <span style="color: navy">
{</span> <span style="color: navy">
<b>
int</b></span> iSearchNr = oSearch.<span style="color: red">
"Absolute Number"</span>; <span style="color: navy">
<b>
if</b></span> (iSearchNr == iCurNr) <span style="color: navy">
{</span> oBS = oSearch; <span style="color: navy">
<b>
break</b></span> <span style="color: navy">
}</span> <span style="color: navy">
}</span> <span style="color: navy">
}</span> <span style="color: darkgreen">
// --------------------</span> <span style="color: navy">
<b>
if</b></span> (<span style="color: navy">
<b>
null</b></span> oBS) halt <span style="color: darkgreen">
// we did not find anything</span> <span style="color: darkgreen">
// Use this for DXL Layout</span> <span style="color: darkgreen">
// displayRichWithColor richTextWithOle(oBS."Object Text")</span> <span style="color: darkgreen">
// Use this for a DXL attribute</span> oCur.attrDXLName = richText richTextWithOle(oBS.<span style="color: red">
"Object Text"</span>)</code>
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
Excellent that works perfectly! :) Just what I was after, this makes the Change Management on our requirements modules a whole lot slicker now, as we don't need a "Proposed Text" attribute, users can just make changes directly to the Object Text and see what the baseline was. Thanks once again, much appreciated! :) Rob |
Re: AttrDXL to show baselined version of Object Text
|